@extends('default.mobile.layouts.companyPublic')
@section('title')企业会员注册 | {{Site::get('webname')}} @endsection

{{--首页css--}}
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/mobile/company/common.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/mobile/jquery/select.css')}}">

@endsection
{{--头部标签--}}
@section('tag','基本资料')

{{--主体内容--}}
@section('content')
    <div class="fill" id="fill">
        <div class="form_info" id="form_info">
            <form action="{{url('mobile/company/post_register_basic')}}" onsubmit="return checkBasic('#basicFrom')"  method="post" name="basicFrom" id="basicFrom">
                {{csrf_field()}}
                <dl>
                    <dt><strong>基本信息</strong></dt>
                    <dd></dd>
                </dl>
                <dl>
                    <dt>公司名称<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="company_name" id="company_name"  value="{{$userInfo->company_name}}" placeholder="请输入公司名称" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>公司品牌</dt>
                    <dd><input type="text" name="brands" id="brands"  value="{{old('brands')}}" placeholder="请输入公司品牌" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="comkind_select">
                    <input type="hidden" name="comkind" value="{{old('comkind')}}" id="comkind" />
                    <dt>公司性质<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择公司性质</span></dd>
                </dl>
                <dl class="arrow" id="industry_select">
                    <input type="hidden" name="industry" value="{{old('industry')}}" id="industry" />
                    <dt>所属行业<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择所属行业</span></dd>
                </dl>
                <dl class="arrow" id="established_select">
                    <input type="hidden" name="established" value="{{old('established')}}" id="established" />
                    <dt>成立年份<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择成立年份</span></dd>
                </dl>

                <dl class="arrow" id="employee_num_select">
                    <input type="hidden" name="employee_num" value="{{old('employee_num')}}" id="employee_num" />
                    <dt>员工数量<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择员工数量</span></dd>
                </dl>
                <dl class="arrow" id="temptation_select">
                    <input type="hidden" name="temptation" value="{{old('temptation')}}" id="temptation" />
                    <dt>公司诱惑<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择公司诱惑</span></dd>
                </dl>
                <dl class="arrow" id="company_profile">
                    <dt>公司简介<span class="asterisk">*</span></dt>
                    <dd>
                        <textarea name="profile" id="profile" style="display: none;">{{old('profile')}}</textarea>
                        <span class="select_text">请输入公司简介</span>
                    </dd>
                </dl>
                <dl>
                    <dt><strong>联系方式</strong></dt>
                    <dd></dd>
                </dl>
                <dl>
                    <dt>联系人<span class="asterisk">*</span></dt>
                    <dd><input type="text" name="contacts" id="contacts"  value="{{$userInfo->contacts}}" placeholder="请输入联系人" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>手机号码</dt>
                    <dd><input type="text" name="mobile" id="mobile"  value="{{$userInfo->mobile}}" placeholder="请输入手机号码" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>联系电话</dt>
                    <dd><input type="text" name="phone" id="phone"  value="{{$userInfo->phone}}" placeholder="格式:0576-82441111" autocomplete="off"></dd>
                </dl>
                <div class="other"><span><em>*</em>固定电话与手机号码必须填写一项</span></div>
                <dl>
                    <dt>传真号码</dt>
                    <dd><input type="text" name="fax" id="fax"  value="{{old('fax')}}" placeholder="格式:0576-82441111" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>电子邮件</dt>
                    <dd><input type="text" name="email" id="email"  value="{{$userInfo->email}}" placeholder="请输入电子邮件" autocomplete="off"></dd>
                </dl>
                <dl>
                    <dt>QQ号码</dt>
                    <dd><input type="text" name="qq" id="qq"  value="{{old('qq')}}" placeholder="请输入QQ号码" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="region_select">
                    <input type="hidden" name="region" value="{{old('region')}}" id="region" />
                    <dt>所在地区<span class="asterisk">*</span></dt>
                    <dd><span class="select_text">请选择所在地区</span></dd>
                </dl>

                <dl class="arrow" id="det_address">
                    <dt>详细地址<span class="asterisk">*</span></dt>
                    <dd>
                        <textarea name="address" id="address" style="display: none;">{{old('address')}}</textarea>
                        <span class="select_text">请输入详细地址</span>
                    </dd>
                </dl>
                <dl>
                    <dt>公司网站</dt>
                    <dd><input type="text" name="website" id="website"  value="{{old('website')}}" placeholder="请输入公司网站" autocomplete="off"></dd>
                </dl>
                <dl class="arrow" id="bycar_lines">
                    <dt>乘车路线</dt>
                    <dd>
                        <textarea name="lines" id="lines" style="display: none;">{{old('lines')}}</textarea>
                        <span class="select_text">请输入乘车路线</span>
                    </dd>
                </dl>

                <div class="form_sub"><input type="submit" value="保存"></div>
            </form>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    <script type="text/javascript" src="{{Resources::jsOption('company')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_time.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_welfare.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.select_single.js')}}"></script>
    <script type="text/javascript" src="{{Resources::jsProvinceArea()}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/jquery.textarea.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/company/basic.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/mobile/jquery/zepto.scroll.js')}}"></script>

    <script>
        var _token =  '{{csrf_token()}}';
        var fill = $("#fill").find('#form_info');
        $(function(){
            //公司性质
            fill.find("#comkind_select").select({
                select_title:'公司性质',
                hidden: '#comkind',
                opt_data:option_comkind
            });
            //所属行业
            fill.find("#industry_select").select({
                select_title:'所属行业',
                hidden: '#industry',
                opt_data:option_industry
            });
            //成立年份
            fill.find("#established_select").select_time({
                select_title:'成立年份',
                hidden: '#established'
                //toDate:true
            });
            //员工数量
            fill.find("#employee_num_select").select({
                select_title:'员工数量',
                hidden: '#employee_num',
                opt_data:option_employee_num
            });
            //公司诱惑
            var comTemp = ["双休","包吃","包住","五险","公积金","年终奖","旅游","培训","带薪年假","节日礼物","定期体检","免费班车","加班补贴","交通补贴",
                "话费补贴","员工持股","岗位晋升","8小时工作制","项目提成","美女多","办公高大上","员工餐厅","健身房","活动室","配车"];
            var welfareArr=[];
            if(fill.find("#temptation_select").find('#temptation').val() != '' ){
                welfareArr = fill.find("#temptation_select").find('#temptation').val().split(",");
                for(var i=0;i<welfareArr.length;i++){
                    if($.inArray(welfareArr[i],comTemp) == '-1'){
                        comTemp.push(welfareArr[i]);
                    }
                }
            }
            fill.find("#temptation_select").select_welfare({
                select_title:'公司诱惑',
                hidden: '#temptation',
                opt_data: comTemp
            });
            //点击公司简介
            fill.find("#company_profile").textarea({
                text_title:'公司简介',
                hidden: '#profile'
            });
            //----------------------------------------------------------------------------------------------------------------------------------------
            //所在地区选择
            fill.find("#region_select").select_single({
                select_title:'所在地区',
                hidden: '#region',
                opt_city:option_city,
                opt_province:option_province
            });
            //点击详细地址
            fill.find("#det_address").textarea({
                text_title:'详细地址',
                hidden: '#address'
            });
            //点击乘车路线
            fill.find("#bycar_lines").textarea({
                text_title:'乘车路线',
                hidden: '#lines'
            });
        });

        //错误信息提示
                @if(count($errors)>0)
                @if(is_object($errors))
        var msgErr='';
        @foreach($errors->all() as $error)
                msgErr += "<p style='line-height: .4rem; width: 100%'>{{$error}};</p>";
        @endforeach
        layerMsg(msgErr,2);
        @endif
    @endif
    @if(session('ok'))
        layerMsg("{{session('ok')}}",2);
        @endif
    </script>
@endsection